<%--
  Created by IntelliJ IDEA.
  User: 24186
  Date: 2022-02-13
  Time: 10:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/static/bootstrap-3.4.1-dist/css/bootstrap.css"/>
    <script src="<%=request.getContextPath()%>/static/jquery-2.1.4.js"
            type="text/javascript" charset="utf-8"></script>
    <title>Title</title>
</head>
<body>
<%--    <form action="<%=request.getContextPath()%>/user?method=login" method="post">--%>
<%--        用户名:<input type="text" name="name"/><br/>--%>
<%--        密码:<input type="password" name="password"/><br/>--%>
<%--        <input type="submit" value="登录"/>--%>
<%--    </form>--%>
    <form class="form-horizontal" action="<%=request.getContextPath()%>/user?method=login" method="post">
        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">姓名</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputEmail3" placeholder="姓名" name="name">
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">密码</label>
            <div class="col-sm-10">
                <input type="password" class="form-control" name="password" id="inputPassword3" placeholder="密码">
            </div>
        </div>
        <div class="form-group">
            <label for="code" class="col-sm-2 control-label">验证码</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="code" id="code" placeholder="验证码">
                <img id="imgCode" onclick="refreshCode()" src="<%=request.getContextPath()%>/code"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <div class="checkbox">
                    <label>
                        <input type="checkbox"> Remember me
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">登录</button>
            </div>
        </div>
    </form>

<%--    <script type="text/javascript">--%>
<%--        function refreshCode() {--%>
<%--            $('#imgCode').attr('src','<%=request.getContextPath()%>/code_test?'+Math.random());--%>
<%--        }--%>
<%--    </script>--%>
    <script type="text/javascript">
        function refreshCode() {
            $('#imgCode').attr('src', '<%=request.getContextPath()%>/code?' + Math.random());
        }
    </script>

</body>
</html>
